#print numbers 1-10 in three different ways 
$i = 1; 
while ($i<=10) { 
   print "$i\n"; 
   $i++; 
} 

for ($i=1;$i<=10;$i++) { 
    print "$i\n"; 
} 

foreach $i (1,2,3,4,5,6,7,8,9,10) { 
    print "$i\n"; 
}


Stop a loop, or force continuation:
	last;     # C break
	
	next;    # C continue;


Exe